
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title">查看房间</h4>
</div>

<div class="modal-body">
	<div class="row" style="margin-top: 10px;">
		<div class="col-md-4">邮轮:</div>
		<div class="col-md-8"><?=$model->cruise->name?></div>
	</div>
	<div class="row">	
		<div class="col-md-4">甲板层数:</div>
		<div class="col-md-8"><?=$model->deck?></div>
	</div>
	<div class="row">
		<div class="col-md-4">房间号:</div>
		<div class="col-md-8"><?=$model->code?></div>
	</div>
	<div class="row">
		<div class="col-md-4">房型:</div>
		<div class="col-md-8"><?=\yii::$app->params['room_type'][$model->type]?></div>
	</div>
	<div class="row">	
		<div class="col-md-4">房型代码:</div>
		<div class="col-md-8"><?=$model->type_code?></div>
	</div>
	<div class="row">
		<div class="col-md-4">最大入住人数:</div>
		<div class="col-md-8"><?=$model->num?></div>
	</div>	
	<div class="row">
		<div class="col-md-4">
		</div>	
		<div class="col-md-8">
			<?php if($rcp){ ?>
				<button class="btn btn-danger del-room-code"  data-id="<?=$rcp->id?>">删除房间号</button>
			<?php }?>
		</div>
	</div>	
</div>


<script type="text/javascript">

$(".del-room-code").click(function() {
	var rcp_id = $(this).data("id");
	if(confirm('确认要删除房间号吗?') == false){
		return false;
	}

	$.get("/cruise/deck/del-room",{rcp_id:rcp_id},function(data){
		if(data == 1){
			alert('删除房号成功!');
			window.location.reload();
		}else{
			alert('删除房号失败!');
			return false;
		}
    });

});

</script>

